﻿<UserControl x:Class="WiiChuckDemo.ModelVisualizer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="434" d:DesignWidth="510">
	<UserControl.Background>
		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FFD9EBF3" Offset="0"/>
			<GradientStop Color="#FF73B4E0" Offset="1"/>
		</LinearGradientBrush>
	</UserControl.Background>
    <Grid>
        <Viewport3D x:Name="viewport">
            <Viewport3D.Camera>
                <PerspectiveCamera FarPlaneDistance="100.000000" NearPlaneDistance="0.100000" UpDirection="0,1,0" LookDirection="0,0,-1" Position="0,0,0" FieldOfView="49.134343">
                    <PerspectiveCamera.Transform>
                    	<Transform3DGroup>
                    		<RotateTransform3D d:EulerAngles="90,0,90">
                    			<RotateTransform3D.Rotation>
                    				<AxisAngleRotation3D Axis="0.577,0.578,0.578" Angle="120.028"/>
                    			</RotateTransform3D.Rotation>
                    		</RotateTransform3D>
                    		<TranslateTransform3D OffsetX="14"/>
                    	</Transform3DGroup>
                    </PerspectiveCamera.Transform>
                </PerspectiveCamera>
            </Viewport3D.Camera>
            <Viewport3D.Children>
                <ModelVisual3D x:Name="light">
                    <ModelVisual3D.Content>
                        <DirectionalLight >
                        	<DirectionalLight.Transform>
                        		<Transform3DGroup>
                        			<TranslateTransform3D OffsetZ="0" OffsetX="0" OffsetY="0"/>
                        			<ScaleTransform3D ScaleZ="1" ScaleY="1" ScaleX="1"/>
                        			<RotateTransform3D d:EulerAngles="15.659,50.662,-9.711">
                        				<RotateTransform3D.Rotation>
                        					<AxisAngleRotation3D Axis="0.344,0.893,-0.29" Angle="54.933"/>
                        				</RotateTransform3D.Rotation>
                        			</RotateTransform3D>
                        			<TranslateTransform3D OffsetZ="0" OffsetX="0" OffsetY="0"/>
                        			<TranslateTransform3D OffsetX="1.185" OffsetZ="3.355" OffsetY="-3.578"/>
                        		</Transform3DGroup>
                        	</DirectionalLight.Transform>
                        </DirectionalLight>
                    </ModelVisual3D.Content>
                </ModelVisual3D>

                <ModelVisual3D x:Name="content" Content="{StaticResource MesserschmittModel}">
                	<ModelVisual3D.Transform>
                		<Transform3DGroup>
                			<RotateTransform3D >
                				<RotateTransform3D.Rotation>
                					<AxisAngleRotation3D Axis="-1,0,0" Angle="{Binding Roll}"/>
                				</RotateTransform3D.Rotation>
                			</RotateTransform3D>
                			<RotateTransform3D >
                				<RotateTransform3D.Rotation>
                					<AxisAngleRotation3D Axis="0,-1,0" Angle="{Binding Pitch}"/>
                				</RotateTransform3D.Rotation>
                			</RotateTransform3D>
                		</Transform3DGroup>
                	</ModelVisual3D.Transform>
                </ModelVisual3D>
            </Viewport3D.Children>
        </Viewport3D>
    </Grid>
</UserControl>
